package com.ugoodtech.mdcc.client.controller;

import com.ugoodtech.mdcc.client.dto.JsonResponse;
import com.ugoodtech.mdcc.core.domain.Reference;
import com.ugoodtech.mdcc.core.repository.ReferenceRepository;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("referenceController")
public class ReferenceController {

    @Autowired
    private ReferenceRepository referenceRepository;

    @ApiOperation("添加行业参考值")
    @RequestMapping(value = "addreference", method = RequestMethod.GET)
    public JsonResponse addreference(String referenceName,String str, String results, String advice,String scope) {
        Reference reference = new Reference();
        reference.setStr(str);
        reference.setResults(results);
        reference.setAdvice(advice);
        reference.setReferenceName(referenceName);
        reference.setScope(scope);
        referenceRepository.save(reference);
        return JsonResponse.successResponse();
    }

}
